package com.dream.tihai.struct;

import com.dream.tihai.dto.TreeTypeDto;
import com.dream.tihai.entity.TypeEntity;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author Valley
 * Created by Valley on 2022/12/14
 */
@Mapper
public interface TypeStruct {

    TypeStruct INSTANCE = Mappers.getMapper(TypeStruct.class);

    @Mapping(target = "value", source = "id")
    @Mapping(target = "label", source = "name")
    TreeTypeDto toTreeType(TypeEntity entity);

    List<TreeTypeDto> toTeeType(List<TypeEntity> entities);

}
